package com.example.littleken.recyclerviewtext.Activitys;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.example.littleken.recyclerviewtext.Adapter.LinearAdapter;
import com.example.littleken.recyclerviewtext.R;

public class LinearRecyclerViewActivity extends AppCompatActivity {
    private RecyclerView recyclerView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.linearrecyclerview);
        recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
        //设置布局管理器，（线性布局管理器）
        recyclerView.setLayoutManager(new LinearLayoutManager(LinearRecyclerViewActivity.this));
        //设置适配器
        recyclerView.setAdapter(new LinearAdapter(this));
    }

}
